package com.demo.common.entity;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 聊天室表(ChatRoom)
 *
 * @author why
 * @since 2025-09-23 10:12:42
 */
@Data
@TableName("chat_room")
public class ChatRoom implements Serializable {

    private static final long serialVersionUID = -64768991399318211L;

    /**
     * 房间ID
     **/
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 房间名称
     **/
    private String roomName;

    /**
     * 房间类型：GROUP-群聊，PRIVATE-私聊
     **/
    private String roomType;

    /**
     * 房间描述
     **/
    private String roomDescription;

    /**
     * 创建者ID
     **/
    private Long creatorId;

    /**
     * 最大成员数
     **/
    private Integer maxMembers;

    /**
     * 是否活跃
     **/
    private Integer isActive;

    private String avatar;

    /**
     * 创建时间
     **/
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     **/
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}



